Update MediaElement.js to 7.1.0 - #6714
Draft
adamsilverstein wants to merge 12 commits into
Draft
Conversation
…est' into 56320-update-mediaelement-to-latest
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
The 7.1.0 release adds keyboard play/pause controls on the player container, screen reader text for current time and total duration, and mobile/desktop fullscreen fixes. No public API changes affect the WordPress integration. Also bump the registered script and style versions from 4.2.17 to 7.1.0 so browsers cache-bust the updated files, and drop the favicon.ico that was copied in from the npm package by mistake - WordPress does not ship it.
Since MediaElement.js 7.0, MediaElementPlayer.prototype.remove() no longer deletes the destroyed player from the mejs.players registry. WordPress iterates that registry to pause and tear down players (wp.media.mixin.removeAllPlayers(), mce-view), and wp-playlist re-creates a player on the same node for every track change, so stale entries would accumulate and dead players would be acted on. Wrap remove() in the migrate shim to restore the pre-7.0 cleanup.
QUnit now loads mediaelement-migrate.js in the same order production does and exercises the API surface WordPress depends on: the mejs globals, the migrate shim aliases, the jQuery integration, the player methods used by media-audiovideo and wp-playlist, and a functional check that instantiating a player builds controls from the configured iconSprite and that remove() unregisters the player. The PHPUnit tests read the bundled library version out of mediaelement-and-player.js and assert every registered mediaelement script and style version matches it, so the files can no longer be updated without bumping the registered versions (or vice versa), and verify the localized settings carry a resolvable iconSprite path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude handled the version bump and wrote up the details:
AI Use
Code, tests, and description all written with 🤖 Claude Code. I will review and test.